﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<div>
    <form id="frmLogin" action="/Home/LoginCustomer">     
             
            <div class="Clearfix lgInput">
                <input type="text" name="UserName" class="inputUsName"  onkeypress=" if (event.keyCode == 13) {submitLogin();}" />
                <br />
                <input type="password" name="Password" class="inputPass"  onkeypress=" if (event.keyCode == 13) {submitLogin();}"  />
            </div>
            <div>
                <button type="button" class="bntLogin" onclick="submitLogin();">
                    Login</button>
            </div>
       
        </form>

</div>


<script type="text/javascript">
    function submitLogin() {
        //Account_Script.submitLogin(this.document.forms[0]);
        
        $.ajax({ type: 'POST', url: '/Home/LoginCustomer', data: $('#frmLogin').serialize(), success: function (response) {
            if (response == "False") {
                alert("User Name or Password Invalid!!");
            }
            else {

                $("#header").load("/Home/ReloadLogon");
                
                //document.location = response;
            }
        }
        });

    }
</script>
